TcpSocketPosix

class TcpSocketPosix(val sendCtxt: CoroutineContext, val receiveCtxt: CoroutineContext)

Constructors

Link copied to clipboard
constructor(sendCtxt: CoroutineContext, receiveCtxt: CoroutineContext)

Properties

Link copied to clipboard

Returns number of bytes that can be read without blocking. If the platform cannot determine this (TLS), -1 is returned

Link copied to clipboard
open val localAddress: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val remoteAddress: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
var sock: Int

Functions

Link copied to clipboard
open fun close()

Close the underlying connection

Link copied to clipboard
open fun connect(name: String, port: Int, connectTimeout: Int, sockOptions: <Error class: unknown class>.() -> Unit?)

Attempt to connect

Link copied to clipboard
open fun finalize()
Link copied to clipboard
open fun flush()

force any writes to actually be sent

Link copied to clipboard
open fun isAlive(): Boolean

Return true if the underlying connection is ok

Link copied to clipboard
open fun readAvailable(dst: ByteArray, offset: Int, length: Int): Int

Reads all available bytes to dst buffer and returns immediately or suspends if no bytes available @return number of bytes were read or -1 if the channel has been closed

Link copied to clipboard
fun setSocketOption(flag: Int, value: Int): Int
Link copied to clipboard
open fun writeFully(src: ByteArray, offset: Int, length: Int)

Writes all src bytes and suspends until all bytes written. Causes flush if buffer filled up or when autoFlush Crashes if channel get closed while writing